home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C ++ / Frameworks / SCAPI 0.85 / Spunk Cross API 1.0 / WinSCAPI / Headers / SCAPITimer.h < prev    next >
Encoding:
Text File  |  1997-06-19  |  1.6 KB  |  83 lines  |  [TEXT/CWIE]

  1. // ===========================================================================
  2. //    SCAPITimer.h                ©1997 Spunk Cross         All rights reserved.
  3. // ===========================================================================
  4.  
  5. #ifndef SCAPITIMER_H
  6. #define SCAPITIMER_H
  7.  
  8. #include "SCAPICommonIncludes.h"
  9.  
  10.  
  11. // ---------------------------------------------------------------------------
  12. //        Defines
  13. // ---------------------------------------------------------------------------
  14.  
  15. #define    MAX_NUM_TIMERS                100
  16.  
  17.  
  18. // ---------------------------------------------------------------------------
  19. //        SCAPITimer Class
  20. // ---------------------------------------------------------------------------
  21.  
  22. class SCAPITimer
  23. {
  24.     friend class MFCApp;
  25.  
  26.     // ===========================================================
  27.     // === Spunk Cross API, these are the routines you can use ===
  28.     // ===========================================================
  29.     
  30.         // Constructor - Destructor
  31.         // ------------------------
  32.         
  33.     public:
  34.     
  35.         SCAPITimer(float    inInterval);
  36.         
  37.         ~SCAPITimer();
  38.         
  39.         
  40.         // Member functions
  41.         // ----------------
  42.         
  43.     public:
  44.     
  45.         void    SetInterval(float    inInterval);
  46.         
  47.         
  48.     protected:
  49.     
  50.         virtual void    Tick();
  51.         
  52.         
  53.     // =================================
  54.     // === Internal part, do not use ===
  55.     // =================================
  56.     
  57.         // Member variables
  58.         // ----------------
  59.         
  60.     private:
  61.     
  62.         float        mInterval;
  63.         DWORD        mReferenceTickCount;
  64.         
  65.         
  66.         // Static functions
  67.         // ----------------
  68.         
  69.     private:
  70.     
  71.         static void        DevoteTime();
  72.         
  73.         
  74.         // Static variables
  75.         // ----------------
  76.         
  77.     private:
  78.     
  79.         static SCAPITimer*        sTimerList[MAX_NUM_TIMERS];
  80.         static int                sTimerListLength;
  81. };
  82.  
  83. #endif